package solved;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

/*
 ID:	liluyan1
 LANG:	JAVA
 TASK:	friday
 */
public class friday {
	private final static int[] REGULAR = new int[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	private final static int[] LEAP = new int[]{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
	
	public static void main(String[] args) throws IOException {
		BufferedReader f = new BufferedReader(new FileReader("friday.in"));
		int[] count = new friday().count(Integer.parseInt(f.readLine().trim()));
		
		PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(
				"friday.out")));
		for (int i=0; i<7; i++) {
			out.print(count[i] + (i==6? "\n" : " "));
		}
		out.close();
		System.exit(0);
	}
	
	private int[] count(int N) {
		int[] res = new int[7];
		int day = (2 + 13 - 1) % 7;		// Jan 13, 1900
		for (int i=0; i<N; i++) {
			int[] month = isLeap(1900+i)? LEAP : REGULAR;
			res[day]++;
			for (int j=0; j<11; j++) {
				day = (day + month[j]) % 7;
				res[day]++;
			}
			day = (day + month[11]) % 7;
		}
		
		return res;
	}
	
	private boolean isLeap(int year) {
		if (year % 4 != 0) return false;
		if (year % 400 == 0) return true;
		return year % 100 == 0? false : true;
	}
}
